package com.plian.system.enumeratea;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description:
 * @author: gangan
 * @create: 2022-01-13 09:51
 */

@Getter
@AllArgsConstructor
public enum ExcelTableName {

    certification("/frontend/certification-form-new", "0001"),

    trouble("/frontend/trouble-shooting-new", "0004"),

    work("/frontend/work-safety-list", "0005");

    private String url;

    private String code;

    public static String urlToCode(String url){
        for (ExcelTableName excelTableName : ExcelTableName.values()){
            if (excelTableName.getUrl().equals(url)){
                return excelTableName.getCode();
            }
        }
        return null;
    }
}
